package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.model.domain.Order;
import com.weixing.mall.provider.model.domain.OrderGoods;
import com.weixing.mall.provider.model.dto.CustomerChgOrderGoodsDto;
import com.weixing.mall.provider.model.dto.ShipperChgOrderGoodsDto;
import com.weixing.mall.provider.model.query.CommoditySalesQuery;
import com.weixing.mall.provider.model.query.FrontShipperOrderSearchQuery;
import com.weixing.mall.provider.model.query.MarketQuery;
import com.weixing.mall.provider.model.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 订单模块-订单商品关联表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-20
 */
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {

    Long getProductId(String productSkuDesp, Long goodsId);

    void shipperChgOrderGoods(@Param("qs")ShipperChgOrderGoodsDto shipperChgOrderGoodsDto);

    void customerChgOrder(@Param("qs") CustomerChgOrderGoodsDto customerChgOrderGoodsDto);

    void chgGoodsProductId(@Param("orderId")Long orderId,@Param("productId")Long productId);

    List<FrontOrderGoodsVo> selectFrontOrderGoodsVoByOrderId(Long orderId);

    /**
     * 根据id返回单个查询结果
     * @param entity
     * @return
     */
    ShipperOrderDetailsVo shipperOrderDetailsVo(FrontShipperOrderSearchQuery entity);
/*

*通过订单商品状态和货品id来查询具体的清单信息
 */
    IPage<CommoditySalesVo> listByProductStatus(@Param("pg") Page initMpPage,CommoditySalesQuery commoditySalesQuery);

    List<MarketReportVo> marketIndex(@Param("qs") MarketQuery marketQuery,@Param("array") Long[]ids);

    List<Order> selectByOrderStatus(@Param("orderStatus")Integer orderStatus,@Param("mateRule")Integer mateRule, @Param("orderType") Integer orderType,@Param("array") Long[]ids);

    OrderGoodsVo findByOrderId(Long orderId);

    List<OrderGoodsVo> orderSyn();
}
